package com.lalameow.researchstation

import com.lalameow.researchstation.api.researching.Researching
import net.fabricmc.fabric.api.lookup.v1.entity.EntityApiLookup
import net.minecraft.entity.EntityType

internal fun ResearchStation.registerLookups() = with(Lookups) {
    RESEARCHING.registerForType(
        { entity, _ -> if (entity is Researching) entity else null },
        EntityType.PLAYER
    )
}

val ResearchStation.lookups: Lookups
    get() = Lookups

object Lookups {
    val RESEARCHING = EntityApiLookup.get(
        ResearchStation.identifier("researching"),
        Researching::class.java,
        Void::class.java
    )!!
}
